package cn.edu.gduf.luowowo.search.service.impl;

import cn.edu.gduf.luowowo.search.domain.UserInfoTemplate;
import cn.edu.gduf.luowowo.search.repository.UserInfoSearchRepository;
import cn.edu.gduf.luowowo.search.service.IUserInfoSearchService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;

import java.util.List;

@Service
public class UserInfoSearchServiceImpl implements IUserInfoSearchService {
    @Autowired
    private UserInfoSearchRepository repository;
    @Autowired
    private ElasticsearchTemplate template;

    @Override
    public void saveOrUpdate(UserInfoTemplate userInfo) {
        repository.save(userInfo);
    }

    @Override
    public List<UserInfoTemplate> getUserByDestName(String destName) {
        return repository.findByDestName(destName);
    }
}
